<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="exp_report" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 增加实验报告 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="报告编号" prop="report_num">
              <el-input v-model="exp_report.report_num" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="申请编号" prop="apply_num">
              <el-input v-model="exp_report.apply_num" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="实验室名称" prop="laboratory_name">
              <el-input v-model="exp_report.laboratory_name" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="认可号" prop="accept_num">
              <el-input v-model="exp_report.accept_num" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="出具时间" prop="certificate_date">
              <el-date-picker v-model="exp_report.certificate_date" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="实验报告" prop="">
              <input type=file />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="addExperimentReportSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'AddExperimentReport',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        exp_report: {
          report_num: null,
          apply_num: null,
          laboratory_name: null,
          accept_num: null,
          certificate_date: null,
        },
        loading: false,
        rules: {}
      }
    },
    created() {},
    updated() {},
    mounted() {},
    methods: {
      addExperimentReportSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/mes/certificate/CertificateAction/addExperimentReportSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.$router.replace("/redirect" + this.$route.fullPath);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
